Plex.Lib.CSS.load('UI.Page.Intro');
Plex.Lib.JS.load('UI.Button.Large_Text');

Plex.UI.Page.Intro = function()
{
	var self = this;

	this.onOpen = function(){};
	this.onClose = function(){};

	this.el = {};
	
	this.el.mainDiv = new Element('div',{
		'class':'Intro',
		'styles':{
			'z-Index':(Plex.UI.zIndex++)
		}
	})
	
	this.el.pageDiv = new Element('div',{
		'class':'page'
	}).injectInside(this.el.mainDiv);
	
	this.el.closeButton = new Element('div',{
		'class':'closeButton',
		'events':{
			'click':function(){
				self.close();
			}
		}
	}).injectInside(this.el.mainDiv);
	
	this.el.pageTitle = new Element('div',{
		'class':'title'
	}).injectInside(this.el.pageDiv);
	
	this.el.bodyDiv = new Element('div',{
		'class':'body'
	}).injectInside(this.el.pageDiv);

	this.open = function()
	{
		self.el.mainDiv.injectInside(document.body);
		self.el.mainDiv.style.zIndex=Plex.UI.zIndex++;
		self.onOpen();
	}
	
	this.close = function()
	{
		Plex.S$.remove(self.el.mainDiv)
		self.onClose();
	}
	
	this.setTitle = function(newTitle)
	{
//		self.el.pageTitle.setText(newTitle);
	}

	this.body = this.el.bodyDiv;
	
	//Context Menu
	this.context = new Plex.UI.Input.Context(this.el.mainDiv);
	this.context.addOption("Close",this.close,'cancel');
}
